/*******************************************************************************
* Copyright (c) 2010, 2018 西安秦晔信息科技有限公司
* Licensed under the Apache License, Version 2.0 (the "License");
*    you may not use this file except in compliance with the License.
*    You may obtain a copy of the License at
*
*       http://www.apache.org/licenses/LICENSE-2.0
*
*    Unless required by applicable law or agreed to in writing, software
*    distributed under the License is distributed on an "AS IS" BASIS,
*    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*    See the License for the specific language governing permissions and
*    limitations under the License.
*******************************************************************************/
package com.qinyeit.serviceapp.entity;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.qinyeit.serviceapp.entity.enums.PrintSettingOrderType;
import com.qinyetech.springstage.core.entity.AbstractEntity;

import javax.persistence.*;
import javax.validation.constraints.NotEmpty;
import com.alibaba.fastjson.annotation.JSONField;
import lombok.Builder;
import lombok.experimental.Tolerate;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

/**
 * ClassName: PrintSettingOrderTableData <br/>
 * Function: 单据打印设置动态数据单据明细列诚信 <br/>
 * date: 2019-03-04 16:13:50 <br/>
 *
 * @author liuwenjin
 * @version  1.0
 * @since JDK 1.8
 */
@Builder
@Entity
@Table(name="print_setting_order_table_datas")
public class PrintSettingOrderTableData extends MerchantGroupBaseEntity<Long> {

	private static final long serialVersionUID = 1L;

	// 所属单据打印设置
	@ManyToOne
	@JoinColumn(name="print_setting_order_id")
	@JsonIgnore
	private PrintSettingOrder printSettingOrder = null;

	// 打印类型 (采购入库单/采购退货单/销售出库单/...)
    @Column(name="print_type")
	@Enumerated(EnumType.STRING)
	private PrintSettingOrderType printType;

	// 数据控制 (系统默认不允许调整/客户自定义显示列)
    @Column(name="data_controle")
	private Integer dataControle = null;

	// 数据列名称 (如：商品名称)
    @Column(name="name", length = 100)
	private String name = null;

	// 数据列约定键 (如：goodname)
    @Column(name="code", length = 100)
	private String code = null;

	// 是否打印 (true-打印/false-不打印)
    @Column(name="is_print")
	private Boolean hasPrint = null;

	// 排序权重, 支持整数与小数, 值越大越靠后(列先后顺序, 支持整数与小数, 值越大越靠后) 
    @Column(name="weight",scale=2)
	private Double weight = null;


    @Tolerate
	public PrintSettingOrderTableData() {
		
	}
    @Tolerate
	public PrintSettingOrderTableData(Long id){
    	super.setId(id);
    }

	public PrintSettingOrderType getPrintType() {
		return printType;
	}

	public void setPrintType(PrintSettingOrderType printType) {
		this.printType = printType;
	}

	public Boolean getHasPrint() {
		return hasPrint;
	}

	public void setHasPrint(Boolean hasPrint) {
		this.hasPrint = hasPrint;
	}

	/**
	 * 获取数据控制
	 */
	public Integer getDataControle() {
		return this.dataControle;
	}

    /**
     * 设置数据控制
     */
	public PrintSettingOrderTableData setDataControle(Integer dataControle) {
		this.dataControle = dataControle;
		return this;
	}

	/**
	 * 获取数据列名称
	 */
	public String getName() {
		return this.name;
	}

    /**
     * 设置数据列名称
     */
	public PrintSettingOrderTableData setName(String name) {
		this.name = name;
		return this;
	}

	/**
	 * 获取数据列约定键
	 */
	public String getCode() {
		return this.code;
	}

    /**
     * 设置数据列约定键
     */
	public PrintSettingOrderTableData setCode(String code) {
		this.code = code;
		return this;
	}


	/**
	 * 获取排序权重, 支持整数与小数, 值越大越靠后(列先后顺序, 支持整数与小数, 值越大越靠后)
	 */
	public Double getWeight() {
		return this.weight;
	}

    /**
     * 设置排序权重, 支持整数与小数, 值越大越靠后(列先后顺序, 支持整数与小数, 值越大越靠后)
     */
	public PrintSettingOrderTableData setWeight(Double weight) {
		this.weight = weight;
		return this;
	}

	public PrintSettingOrder getPrintSettingOrder() {
		return printSettingOrder;
	}

	public void setPrintSettingOrder(PrintSettingOrder printSettingOrder) {
		this.printSettingOrder = printSettingOrder;
	}

}
